<div class="table_browse_header"><b>Articles</b><br></div><table width="100%">
    <tbody>
	<tr>
	    <th class="table_browse_field_header">ID</th>
	    <th class="table_browse_field_header">Published</th>
	    <th class="table_browse_field_header">Title</th>
	    <th class="table_browse_field_header">Category</th>
	    <th class="table_browse_field_header">Username</th>
	    <th class="table_browse_field_header">Views</th>
	    <th class="table_browse_field_header">Rating</th>
	    <th class="table_browse_field_header">&nbsp;</th>
	</tr>
	<tr>
	    <% 
		id = 0
		for article in @articles 
		id += 1
	    %>
	    <td class="table_browse_rows_2" align="left"><%= id%></td>
	    <td class="table_browse_rows_2" align="center">
	    <% if article.publish %>
		<font color="green"><b>YES</b></font>
	    <% else %>
		<font color="red"><b>NO</b></font>
	    <% end %></td>
	    <td class="table_browse_rows_2" align="left"><%= article.title%></td>
	    <td class="table_browse_rows_2" align="left"><%= article.category.name%></td>
	    <td class="table_browse_rows_2" align="center"><%= article.user.username%></td>
	    <td class="table_browse_rows_2" align="center"><%= article.views%></td>
	    <td class="table_browse_rows_2" align="center"><%= article.rating%></td>	    
	    <td class="table_browse_rows_2" valign="center"><%= link_to ('Publish&nbsp;|&nbsp;', {:action => 'publish_article', :id=> article}) if !article.publish%><%= link_to 'Edit', {:action => 'edit_article', :id=> article}%>&nbsp;|&nbsp;<%= link_to 'Destroy', {:action => 'destroy_article', :id=> article}, :confirm => "Are you sure?"%></td>
	</tr>
	    <% end %>
    </tbody>
</table>
<div class="table_browse_controls"><center>&nbsp;&nbsp;&nbsp; <%= @articles.length*@article_pages.length %> articles found. &nbsp;&nbsp;
    <% if @article_pages.length > 1 %>
	Pages: <%= pagination_links(@article_pages)%>
    <%end%>&nbsp;&nbsp;&nbsp;</center></div>